',
container = $('#drop-panel-container'),
contents = $(container).html();
if (isIE8) {
$(container).replaceWith(f+contents+b)
}
}
function dropPanelSetUp(data) {
/* buttons should be a dataobject of strings representing IDs
the hide and show functions are expecting IDs so passing a class will result in a
failure.
click as the action is assumed for now
the data object should look like this:
{ masterlistener:(string[dom id]),
panel:(string[dom id]),
eventgroup1:{ button:(string[dom id]),
content:(string[dom id]),
offset:{x:(int),y:(int)},
on_state_class: ''(string)
},
eventgroup2:{ button:(string[dom id]),
content:(string[dom id]),
offset:{x:(int),y:(int)},
on_state_class: ''(string)
} ... etc
}
The drop panel nodes should be placed so they share the same offset parent as the buttons that activate it.
NOTE: IE8 Got-chya: the ID for the panel is hard coded into the IE8 rouned corners code.
If you have changed the ID for the drop panel and are having trouble with IE8
change the ID in the template string in this function: ie8DropPanel()
*/
var speed = 300,
panel = $('#'+data.panel),
buttons = [];
for (var i=1,eg; eg=data[('eventgroup'+i)]; i++) {
var bp = $('#'+eg.button).position(), //button position
ph = $('#'+eg.button).height(), //button height
panelPos = [bp.top+ph, bp.left, eg.offset];
on_state_class = eg.on_state_class;
buttons.push([$('#'+eg.button),$('#'+eg.content),panelPos,eg.button,on_state_class]);
}
$('#'+data.masterlistener).bind('click',{speed:speed,panel:panel,buttons:buttons},function(event){
var org = event.target,
speed = event.data.speed,
panel = event.data.panel,
buttons = event.data.buttons,
panel_open = isPanelOpen(panel);
for (var i=buttons.length-1, b; b=buttons[i]; i--) {
/*
* b[0] = button DOM object
* b[1] = content DOM object
* b[2] = the display co-ord object:
* [0] = top (int)
* [1] = left (int)
* [2] = offset object
* {x,y}(int,int)
* b[3] = button ID (string)
* b[4] = button 'on' class
*/
var button_id = b[3],
same_content = isSameContent(panel,b[1]);
if ( $(org).attr('id') === button_id || $(org).parents('#'+button_id).attr('id')){
if(!same_content) {
hideAllContent(buttons);
movePanel(panel,b[2]);
if (panel_open) {
showContent(b[1],b[0],b[4]);
} else {
showContent(b[1],b[0],b[4]);
showPanel(panel,speed);
}
} else {
hidePanel(panel,speed,b[4]);
}
}
}
function isPanelOpen(panel) {
return ($(panel).css('display').toLowerCase() === 'block');
}
function isSameContent (panel,content) {
return ($(content, panel).css('display').toLowerCase() === 'block');
}
function movePanel(panel,b) {
// b[0] top, b[1] left, b[2] {x,y}
$(panel).css({
'top': (b[0] + b[2].x)
});
$(panel).css({
'left': (b[1] + b[2].y)
});
}
function showPanel(panel,speed) {
$(panel).slideDown(speed);
}
function hidePanel(panel,speed) {
$(panel).slideUp(speed, function() {hideAllContent(buttons);});
}
function showContent(content, button, btn_class) {
$(content).show();
$(button).addClass(btn_class);
}
function hideContent(content) {
$(content).hide();
}
function hideAllContent(buttons) {
for (var i = buttons.length-1, b; b=buttons[i]; i--) {
$(b[1]).hide();
$(b[0]).removeClass(b[4]);
}
}
})
}
return {
ieRoundedCorners:ieRoundedCorners,
ie8DropPanel:ie8DropPanel,
dropPanelSetUp:dropPanelSetUp
}
})();
var headerNavication = (function($,cw) {
var nav_item_list = $('.cw-header .main-nav ul.main > li'),
channel_id_list = '',
channel,
sub_channel;
var findChannel = function () {
var winloc = isIE ? document.URL.split('/') : document.documentURI.split('/') ,
channel_id = winloc[3],
sub_chanel_id = winloc.length > 5 ? '/'+winloc[4]+'/' : '',
reg_sub_find_id = new RegExp(sub_chanel_id,'ig'),
reg_removed_id = /^nav-/i;
for (var i=nav_item_list.length-1,n; n=nav_item_list[i]; i--) {
if ( channel_id === $(n).children('a').attr('id').replace(reg_removed_id,'') ) {
var list = $(n).children('ul').children('li');
if (sub_chanel_id.length > 0) {
for (var j=list.length-1,l; l=list[j]; j--) {
if (reg_sub_find_id.test($(l).children('a').attr('href'))) {
break;
} else {
l = false;
}
}
}
break;
}
}
findChannel = function () {
return [n,l];
}
return [n,l];
}
var init = (function() {
channel = findChannel()[0] || nav_item_list[0];
sub_channel = findChannel()[1];
if (sub_channel) {
highlightSubChannel();
}
clearNav();
if(isIE) {
cw.ieRoundedCorners();
if(isIE8) {
cw.ie8DropPanel();
}
}
if ($('#handle-header').attr('id')) {
cw.dropPanelSetUp({
masterlistener: 'handle-header',
panel: ('drop-panel-container'),
eventgroup1: {
button: 'btn-newspapers',
content: 'panel-newspapers',
offset: {
x: 5,
y: 0
},
on_state_class: 'newspapers-dropdown-on'
},
eventgroup2: {
button: 'btn-networks',
content: 'panel-networks',
offset: {
x: 5,
y: 0
},
on_state_class: 'networks-dropdown-on'
}
});
}
//need to check state of search radio buttons since firefox doesn't reset to the default checked radio button
if($('.cw-header #radio-btn-yp:checked').attr('id') != null){
$('.cw-header #header-search-form').attr('action','http://canadacom.yellowpages.ca/search/');
$('.cw-header #header-search-string').attr('name','what');
$('.cw-header #radio-btn-yp').siblings('label').removeClass('selected');
$('.cw-header #radio-btn-yp').next().addClass('selected');
}
eventSetUp();
}())
function highlightSubChannel() {
$(sub_channel).addClass('sub-nav-highlight');
}
function clearNav() {
clearTabs();
$(channel).children('ul').show();
$(channel).css('background-position', 'bottom right');
}
function eventSetUp() {
$('.cw-header .main-nav ').bind('mouseleave', function(event){
if (isIE) {
if ($(event.relatedTarget).parents('.main-nav').length 0)?"
" + value.substring(0,pos) + "" + value.substring(pos, term.length) + "
" + value.substring(pos + term.length) + "":value.substring(0, term.length) + "
" + value.substring(pos + term.length) + ""; }, scroll: false, selectFirst: false }); });
?
?
?
?
BAGHDAD - Insurgents in Iraq launched two days of bloody assaults at the start of the Muslim holy month of Ramadan that killed at least 31 people, most of them members of the security forces serving in restive Sunni-dominated areas, authorities said Thursday.
The killings are the latest in a wave of bloodshed that has claimed the lives of more than 2,600 people since the start of April. The months-long eruption of violence ? Iraq's worst in half a decade ? is raising fears the country is again returning to the brink of a civil war pitting its Sunni and Shiite Muslim sects against one another.
The deadliest attack happened at sundown Wednesday as Iraqis were marking the end of the first day of Ramadan fasting, though it took authorities time to learn of the killing and they only provided details the following morning.
Gunmen launched their assault on an army checkpoint near Barwana, which lies across the Euphrates River from the town of Haditha, about 220 kilometres (140 miles) northwest of Baghdad in the largely Sunni province of Anbar. Barwana's mayor, Meyasser Abdul-Mohsin, said three soldiers were killed and four were wounded in that attack.
The attackers then made their way to a trailer not far away that is used by special oil industry police assigned to protect a nearby pipeline. The men inside were sitting down to have the iftar meal that breaks the daytime Ramadan fast at sunset, Abdul-Mohsin said.
The gunmen shot up the trailer and then set it on fire before making their getaway, the mayor said. Eleven police there were left dead, with some of their bodies badly burned and making them difficult to identify, he said.
A security official in nearby Haditha gave a similar account and confirmed the death toll. He spoke on condition of anonymity because he was not authorized to release the information.
"This is a crime carried out by terrorists during iftar on the first day of Ramadan," Abdul-Mohsin said. "It just proves what a cowardly act it is."
Exxon Mobil Corp., BP PLC and other international oil companies have flocked to Iraq since the 2003 U.S.-led invasion to capitalize on Iraq's vast oil wealth. The country is now the second-largest producer in OPEC, after Saudi Arabia. Oil revenues account for 95 per cent of the country's budget.
Insurgents unleashed more attacks Thursday.
A police station in Anbar's provincial capital Ramadi came under attack in the morning in an assault that left two policemen dead, provincial council member councilman Talib Hamadi and deputy provincial governor Dhari Arkan said. Arkan said gunmen opened fire on the police station after a car bomb exploded nearby. Ramadi is 115 kilometres (70 miles) west of Baghdad.
Militants turned their sights on the local police headquarters in the nearby city of Fallujah, also in Anbar province, later in the day.
A car bomb explosion kicked off that attack. Then gunmen exchanged fire with police as other militants launched mortar rounds at the facility. Another attacker then drove an explosives-laden car into the police post.
By the time it was all over, seven police officers were killed and 17 other people were wounded, all but two of them police, according to police and hospital officials.
A roadside bomb later exploded in central Fallujah, killing a police officer and wounding two others.
Anbar is a vast Sunni-dominated province west of Baghdad and bordering Syria. It has been the centre of months of protests by Iraq's minority Sunnis over what they believe is second-class treatment by the Shiite-dominated government. Sunni militant groups have tried to tap into that anger and link their cause with that of the protesters.
A car bomb rocked Baghdad's commercial district of Karradah late Thursday afternoon, killing two police officers and two civilians, police and health officials said. They said another 13 were wounded.
Insurgents also struck in the volatile city of Mosul, 360 kilometres (225 miles) northwest of the capital. Gunmen in speeding cars there shot and killed an off-duty solider and a civilian in two separate attacks, police and health officials said. Another policeman was killed when a roadside bomb hit a police patrol in the city.
Authorities provided details of the Fallujah, Baghdad and Mosul attacks on condition of anonymity because they weren't allowed to brief reporters.
Elsewhere, a parked car bomb went off Thursday morning near a courthouse in the northern city of Tuz Khormato, wounding 30 people, mayor Shalal Abdool said. Tuz Khormato sits in a band of territory contested by Arabs, Kurds and Turkomen about 200 kilometres (125 miles) north of Baghdad.
Another parked car bomb exploded in a village outside the nearby ethnically disputed city of Kirkuk, wounding seven civilians, provincial police chief Maj. Gen. Jamal Tahir said.
There was no immediate claim of responsibility for the series of attacks. Sunni militants, including al-Qaida's Iraq arm, frequently target security forces and the country's vital oil infrastructure in an effort to undermine the Shiite-led government.
___
Associated Press writer Sinan Salaheddin contributed to this report.
___
Follow Adam Schreck on Twitter at http://twitter.com/adamschreck
?
?
?
?
?
?
?
?
Story Tools
?
?
Font:
?
Image:
?
?
?
?
?
?
?
?
?
?
?
?
?
Also on Driving.ca
?
?
?
?
?
'); document.write('
?
'); var i; // Display each ad in turn for(i = 0; i '); document.write(''); document.write('
Source: http://feeds.canada.com/~r/canwest/F77/~3/uKOF01V0S9s/story.html
earth day Luis Suarez Earth Day 2013 westboro baptist church meteor shower Al Michaels Canelo vs Trout